/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package app.controller;

import app.business.ExaminationSessionBean;
import app.entity.Examination;
import java.util.List;
import javax.ejb.EJB;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;

/**
 *
 * @author DangThanh
 */
@ManagedBean(name = "examinationManagedBean")
@SessionScoped
public class ExaminationManagedBean {

    @EJB
    private ExaminationSessionBean examinationSessionBean;
    private Examination exam;

    public Examination getExam() {
        return exam;
    }

    public void setExam(Examination exam) {
        this.exam = exam;
    }

    /**
     * Creates a new instance of ExaminationManagedBean
     */
    public ExaminationManagedBean() {
        exam = new Examination();
    }

    public List<Examination> getExaminations() {
        return examinationSessionBean.getAllExamination();
    }

    public void addExamination() {
        exam = examinationSessionBean.addExamination(exam);
    }
}
